#ifndef PURG_HELPER_TMPL_H
#define PURG_HELPER_TMPL_H

#ifndef PURG_C_INTERFACE_COMPILE
namespace purg
{
#endif

  template <unsigned int I,unsigned int EXP>
  class pow
  {
    public:
      enum { result = I * pow<I,EXP-1>::result };
  };

  template <unsigned int I>
  class pow<I,0>
  {
    public:
      enum { result = 1 };
  };

  template <unsigned int I,unsigned int BASE=2>
  class discrete_log
  {
    public:
      enum { result = 1+discrete_log<I/2,BASE>::result };
  };

  template <unsigned int BASE>
  class discrete_log<1,BASE>
  {
    public:
      enum { result = 0 };
  };
#ifndef PURG_C_INTERFACE_COMPILE
}
#endif


#endif
